cc.Class({
    extends: cc.Component,

    properties: {
        listLevelLayer: cc.ScrollView,
        prefabLevelLayer: cc.Prefab,
    },

    createLevelLayer() {
         // var levelData = window.getGameLevelDataConfig(36);
        //大关数组
        var groupAreaDatas = [];
        var objLeven = cc.instantiate(this.prefabLeven);
        objLeven.name="objLevel";

        this.node.addChild(objLeven);

        for (let index = 1; index < 37; index++) {
            var levelData = window.getGameLevelDataConfig(index);
            groupAreaDatas.push(levelData);
            //如果满了一大关创建
            if (groupAreaDatas.length === 6) {

                var objLevenCom = objLeven.getComponent("LevelScene");
                objLevenCom.createLevelLayerToScene(groupAreaDatas);
                groupAreaDatas=[];
            }
            // cc.log("groupAreaDatas:"+groupAreaDatas);
        }

    },

    createLevelLayerToScene(){
        let objLevelLayer = cc.instantiate(this.prefabLevelLayer);
        let levelLayerCom = objLevelLayer.getComponent("LevelLayer");
        levelLayerCom.setLevelData(data);
        this.listLevelLayer.content.addChild(objLevelLayer);
    },
    closePanel(event) {
        event.interactable = false;
        let self = this;
        if (!this.node.active) {
            return;
        }

        self.node.runAction(cc.sequence(
            cc.fadeOut(0.3),
            cc.removeSelf(),
        ));
    }
});